package cn.javass.dp.abstractfactory.example1;

public class ComputerEngineer {

    private CPUApi cpu = null;

    private MainboradApi mainborad = null;

    //装机
    public void makeComputer(int cpuType, int mainboradType) {
        //1准备好装机的组件
        prepareHardwares(cpuType, mainboradType);

        //2组装机器
        //3测试机器
        //4交付客户
    }

    private void prepareHardwares(int cpuType, int mainboradType) {
        this.cpu = CPUFactory.getCPU(cpuType);
        this.mainborad = MainBoardFactory.getMainborad(mainboradType);

        cpu.calculate();
        mainborad.installCPU();

    }

}
